﻿@{
    ViewBag.Title = "Forum Browser";
}

@(Html.Kendo().Grid<ForumBrowser.Models.RssItem>()
    .Name("rssItemGrid")
    .Columns(columns =>
    {
        columns.Bound(m => m.Title);
        columns.Bound(m => m.Author).Width(250);
        columns.Bound(m => m.PublicationDate).Width(250);
    })
    .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("GetItems", "Home")))
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
)

@section Details
{
    <div class='k-widget k-alt' style='padding: 5px 5px 5px 5px;visibility:hidden;'>
        <a id='url'></a>
    </div>
    <div id="description" style='padding: 5px 5px 5px 5px;'>
    </div>
}

<script src="@Url.Content("~/Scripts/Index.js")"></script> 

@section onReadyScripts
{
    var rssItemGrid = $('#rssItemGrid').data('kendoGrid');
    rssItemGrid.bind("change", Index.RssItemGrid_onChange);
}